<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>Coordinate (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">math.Coordinate</span>
        <span>Extends</span>
        <span class="fn-name">
          
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Class for representing coordinates and positions.

  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="local_closure_goog_math_coordinate.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/local/closure/goog/math/coordinate.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.math.Coordinate</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
      <tr><td><span class="type"><a href="class_goog_math_Vec2.html">goog.math.Vec2</a></span></td><td>goog.math.Coordinate</td></tr>
  </table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.math.Coordinate(<span><span class="arg">opt_x</span>,&nbsp;<span class="arg">opt_y</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">opt_x</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Left, defaults to 0.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_y</span>
        : <span class="type">number=</span>
        <div class="entryOverview">Top, defaults to 0.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Coordinate.html">
              goog.math.Coordinate
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.ceil"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">ceil<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Rounds the x and y fields to the next larger integer values.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            This coordinate with ceil'd fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line167">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.clone"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">clone<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Returns a new copy of the coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            A clone of this coordinate.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line51">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.floor"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">floor<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Rounds the x and y fields to the next smaller integer values.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            This coordinate with floored fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line178">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.rotateDegrees"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">rotateDegrees<span class="args">(<span class="arg">degrees</span>,&nbsp;<span class="arg">opt_center</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Rotates this coordinate clockwise about the origin (or, optionally, the given
center) by the given angle, in degrees.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">degrees</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The angle by which to rotate this coordinate
    clockwise about the given center, in degrees.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_center</span>
        : <span>!</span><span class="type">goog.math.Coordinate=</span>
        <div class="entryOverview">The center of rotation. Defaults
    to (0, 0) if not given.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line265">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.rotateRadians"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">rotateRadians<span class="args">(<span class="arg">radians</span>,&nbsp;<span class="arg">opt_center</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Rotates this coordinate clockwise about the origin (or, optionally, the given
center) by the given angle, in radians.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">radians</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The angle by which to rotate this coordinate
    clockwise about the given center, in radians.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_center</span>
        : <span>!</span><span class="type">goog.math.Coordinate=</span>
        <div class="entryOverview">The center of rotation. Defaults
    to (0, 0) if not given.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line244">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.round"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">round<span class="args">()</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Rounds the x and y fields to the nearest integer values.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            This coordinate with rounded fields.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line189">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.scale"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">scale<span class="args">(<span class="arg">sx</span>,&nbsp;<span class="arg">opt_sy</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Scales this coordinate by the given scale factors. The x and y values are
scaled by <code> sx</code> and <code> opt_sy</code> respectively.  If <code> opt_sy</code>
is not given, then <code> sx</code> is used for both x and y.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">sx</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The scale factor to use for the x dimension.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_sy</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The scale factor to use for the y dimension.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            This coordinate after scaling.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line228">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.toString"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">toString<span class="args">()</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>
      </div>


     <div class="entryOverview">
       Returns a nice string representing the coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span>&nbsp;
            In the form (50, 73).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line62">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.prototype.translate"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">translate<span class="args">(<span class="arg">tx</span>,&nbsp;<span class="arg">opt_ty</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Translates this box by the given offsets. If a <code> goog.math.Coordinate</code>
is given, then the x and y values are translated by the coordinate's x and y.
Otherwise, x and y are translated by <code> tx</code> and <code> opt_ty</code>
respectively.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">tx</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">The value to translate x by or the
    the coordinate to translate this coordinate by.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_ty</span>
        : <span class="type">number=</span>
        <div class="entryOverview">The value to translate y by.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            This coordinate after translating.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line206">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_math_Coordinate.html">
              goog.math.Coordinate
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>





  <a name="goog.math.Coordinate.prototype.x"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">x</span>
        : 
     </div>


     <div class="entryOverview">
       X-value

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line37">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>





  <a name="goog.math.Coordinate.prototype.y"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">y</span>
        : 
     </div>


     <div class="entryOverview">
       Y-value

     </div>

  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line43">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Static Methods</h2>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.azimuth"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">azimuth<span class="args">(<span class="arg">a</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the angle from the origin to a coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The angle, in degrees, clockwise from the positive X
    axis to <code> a</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line114">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.difference"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">difference<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Returns the difference between two coordinates as a new
goog.math.Coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            A Coordinate representing the difference
    between <code> a</code> and <code> b</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line146">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.distance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">distance<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the distance between two coordinates.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The distance between <code> a</code> and <code> b</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line91">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.equals"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">equals<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
      </div>


     <div class="entryOverview">
       Compares coordinates for equality.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>&nbsp;
            True iff the coordinates are equal, or if both are null.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line74">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.magnitude"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">magnitude<span class="args">(<span class="arg">a</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the magnitude of a coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The distance between the origin and <code> a</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line103">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.squaredDistance"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">squaredDistance<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the squared distance between two coordinates. Squared distances can
be used for comparisons when the actual value is not required.

Performance note: eliminating the square root is an optimization often used
in lower-level languages, but the speed difference is not nearly as
pronounced in JavaScript (only a few percent.)


     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The squared distance between <code> a</code> and <code> b</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line131">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.math.Coordinate.sum"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.math.Coordinate.</span><span class="entryName">sum<span class="args">(<span class="arg">a</span>,&nbsp;<span class="arg">b</span>)</span>
        </span>
        &#8658; <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
      </div>


     <div class="entryOverview">
       Returns the sum of two coordinates as a new goog.math.Coordinate.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">a</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">b</span>
        : <span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>
        <div class="entryOverview">A Coordinate.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span>!</span><span class="type"><a href="class_goog_math_Coordinate.html">goog.math.Coordinate</a></span>&nbsp;
            A Coordinate representing the sum of the two
    coordinates.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_math_coordinate.js.source.html#line158">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package math</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="math.Coordinate"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
